export function isFunction<T extends (...args: never[]) => void>(val: unknown): val is T {
  return typeof val === 'function'
}

export function isObject(val: unknown): val is Record<string, unknown> {
  return val !== null && typeof val === 'object'
}

export function isArray(val: unknown): val is Array<unknown> {
  return Array.isArray(val)
}

export function isString(val: unknown): val is string {
  return typeof val === 'string'
}

export function isNumber(val: unknown): val is number {
  return typeof val === 'number'
}

export function isBoolean(val: unknown): val is boolean {
  return typeof val === 'boolean'
}

export function isNull(val: unknown): val is null {
  return val === null
}

export function isUndefined(val: unknown): val is undefined {
  return val === undefined
}
